using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableShoppingCartTemp
	{
		public const string Table = "ShoppingCartTemp";
		public const string ShoppingCartTempID = "ShoppingCartTempID";
		public const string MembersID = "MembersID";
		public const string Modified = "Modified";
		public const string CartType = "CartType";
	}
	
	[Serializable]
	public class BaseShoppingCartTemp
		: IDbSessionEntity, IJsonClass
	{
		int m_ShoppingCartTempID;
		/// <summary>
        /// 
        /// </summary>
        public int ShoppingCartTempID
        {
            get { return m_ShoppingCartTempID; }
            set { m_ShoppingCartTempID = value; }
        }
		
		int? m_MembersID;
		/// <summary>
        /// 
        /// </summary>
        public int? MembersID
        {
            get { return m_MembersID; }
            set { m_MembersID = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		int m_CartType;
		/// <summary>
        /// 
        /// </summary>
        public int CartType
        {
            get { return m_CartType; }
            set { m_CartType = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ShoppingCartTempID = reader[TableShoppingCartTemp.ShoppingCartTempID];
            m_MembersID = reader[TableShoppingCartTemp.MembersID];
            m_Modified = reader[TableShoppingCartTemp.Modified];
            m_CartType = reader[TableShoppingCartTemp.CartType];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableShoppingCartTemp.ShoppingCartTempID, PrimaryKeyType.Identity, ShoppingCartTempID);
			writer[TableShoppingCartTemp.MembersID] = MembersID;
			writer[TableShoppingCartTemp.Modified] = Modified;
			writer[TableShoppingCartTemp.CartType] = CartType;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ShoppingCartTempID = idd;
        }
		
		public string TableName
        {
            get { return TableShoppingCartTemp.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ShoppingCartTempID = hashToRead["ShoppingCartTempID"];
			 
             m_MembersID = hashToRead["MembersID"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_CartType = hashToRead["CartType"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ShoppingCartTempID"] = ShoppingCartTempID;
			 
            hashToFill["MembersID"] = MembersID;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["CartType"] = CartType;
			 
        }

        #endregion
		
	}
}
